/**
 * @Company: 北京慧点科技有限公司 | www.smartdot.com.cn
 * @Copyright 1998-2020 © Smartdot Technologies Co., Ltd.
 */
package com.springlearn.zhoufei.other.spring.demo2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * 描述该类- JPA
 *
 * @author <a href="mailto:zhoufei@smartdot.com.cn">zhoufei</a>
 * @class: Hello
 * @date 2020/9/18 20:08
 * @Verson 1.0 -2020/9/18 20:08
 * @see
 */
public class HelloWorld2 {
    @Autowired
    private List<HelloWorld1> list;
    
    public void sayHelloWorld1() {
        for (HelloWorld1 helloWorld1 : list) {
            System.out.println(helloWorld1.toString());
        }
    }
    
    public static void main(String[] args) {
        String pathHello = "./other\\Bean2.xml";
        AbstractApplicationContext context = new ClassPathXmlApplicationContext(pathHello);
        HelloWorld2 HelloWorld2 = (HelloWorld2) context.getBean("HelloWorld2");
        HelloWorld2.sayHelloWorld1();
        
    }
}